<?php
declare (strict_types = 1);

namespace app\validate\admin;

use think\Validate;

class AdminMenuValidate extends Validate
{
    protected $field = [
        'pid'       => '上级菜单',
        'rank'      => '排序',
        'title'     => '名称',
        'uri'       => '链接',
        'is_show'   => '显示',
    ];

    protected $rule = [
        'pid'       => 'require|integer|egt:0',
        'rank'      => 'require|integer|egt:0',
        'title'     => 'require|chsDash|max:12',
        'uri'       => 'require|max:50|regex:^[A-Za-z0-9\/\_\-\#]+$',
        'is_show'   => 'require|integer|in:0,1'
    ];

    protected $message = [];
}
